
package com.teamwork_backend.mapper;

import com.teamwork_backend.entity.Positions;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.teamwork_backend.entity.ov.PositionsList;
import com.teamwork_backend.entity.ov.PositionsListView;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PositionsDao extends BaseMapper<Positions> {
    @Select("SELECT positions.name,place,company_info.website,company_info.name as cname FROM positions LEFT JOIN `company_info` on positions.companyid = company_info.companyid WHERE positions.name LIKE CONCAT('%',#{content},'%') OR company_info.name LIKE CONCAT('%',#{content},'%') ")
    List<PositionsListView> searchPositions(@Param("content") String content);


    @Select("SELECT * FROM positions WHERE name LIKE CONCAT('%',#{content},'%') ")
    List<PositionsList> searchallPositions(@Param("content") String content);
}